﻿#include "FITKNasMaterialMAT1.h"

namespace Interface
{
    FITKNasMaterialMAT1::FITKNasMaterialMAT1()
    {
        //初始化值
        _youngsModulus.setDefault(-1);
        _shearModulus.setDefault(-1);
        _poissionRatio.setDefault(0);
        _density.setDefault(0);
        _refTemp.setDefault(0);
        _dampingCoeff.setDefault(0);
        _stessLimits[0].setDefault(0);
        _stessLimits[1].setDefault(0);
        _stessLimits[2].setDefault(0);
        _coodSysID.setDefault(0);
    }

    FITKNasMaterialMAT1::~FITKNasMaterialMAT1()
    {

    }

    Interface::FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType FITKNasMaterialMAT1::getMaterialBehaviorType()
    {
        return FITKAbaMaterialBehaviorEnum::FITKAbaMaterialBehaviorType::NasMAT1;
    }

    void FITKNasMaterialMAT1::setYoungsModulus(const double & value)
    {
        _youngsModulus.setValue(value);
    }

    double FITKNasMaterialMAT1::getYoungsModulus() const
    {
        return _youngsModulus.getValue();
    }

    void FITKNasMaterialMAT1::setShearModules(const double& value)
    {
        _shearModulus.setValue(value);
    }

    double FITKNasMaterialMAT1::getShearModules() const
    {
        return _shearModulus.getValue();
    }

    void FITKNasMaterialMAT1::setPoissionRatio(const double& value)
    {
        _poissionRatio.setValue(value);
    }

    double FITKNasMaterialMAT1::getPoissionRatio() const
    {
        return _poissionRatio.getValue();
    }

    void FITKNasMaterialMAT1::setDensity(const double& value)
    {
        _density.setValue(value);
    }

    double FITKNasMaterialMAT1::getDensity() const
    {
        return _density.getValue();
    }

    void FITKNasMaterialMAT1::setThermalExpCoeff(const double& value)
    {
        _thermalExpCoeff.setValue(value);
    }

    double FITKNasMaterialMAT1::getThermalExpCoeff() const
    {
        return _density.getValue();
    }

    void FITKNasMaterialMAT1::setRefTemp(const double& value)
    {
        _refTemp.setValue(value);
    }

    double FITKNasMaterialMAT1::getRefTemp() const
    {
        return _refTemp.getValue();
    }

    void FITKNasMaterialMAT1::setDampingCoeff(const double& value)
    {
        _dampingCoeff.setValue(value);
    }

    double FITKNasMaterialMAT1::getDampingCoeff() const
    {
        return _dampingCoeff.getValue();
    }


    void FITKNasMaterialMAT1::setStressLimitTension(const double & value)
    {
        _stessLimits[0].setValue(value);
    }

    double FITKNasMaterialMAT1::getStressLimitTension() const
    {
        return _stessLimits[0].getValue();
    }

    void FITKNasMaterialMAT1::setStressLimitCompress(const double & value)
    {
        _stessLimits[1].setValue(value);
    }

    double FITKNasMaterialMAT1::getStressLimitCompress() const
    {
        return _stessLimits[1].getValue();
    }

    void FITKNasMaterialMAT1::setStressLimitShear(const double & value)
    {
        _stessLimits[2].setValue(value);
    }

    double FITKNasMaterialMAT1::getStressLimitShear() const
    {
        return _stessLimits[2].getValue();
    }

    void FITKNasMaterialMAT1::setCoordinateSys(const int & id)
    {
        _coodSysID.setValue(id);
    }

    int FITKNasMaterialMAT1::getCoordinateSys() const
    {
        return _coodSysID.getValue();
    }

    const Core::FITKAbstractParamValueDouble& FITKNasMaterialMAT1::getParam(const QString & param, bool& res)
    {
        res = true;
        if (param == "YoungsModulus")
            return _youngsModulus;
        else if (param == "ShearModules")
            return _shearModulus;
        else if (param == "PoissionRatio")
            return _poissionRatio;
        else if (param == "Density")
            return _density;
        else if (param == "ThermalExpCoeff")
            return _thermalExpCoeff;
        else if (param == "RefTemp")
            return _refTemp;
        else if (param == "DampingCoeff")
            return _dampingCoeff;
        else if (param == "StressLimitTension")
            return _stessLimits[0];
        else if (param == "StressLimitCompress")
            return _stessLimits[1];
        else if (param == "StressLimitShear")
            return _stessLimits[2];
        else
            res = false;
        return Core::FITKAbstractParamValueDouble();
    }

}

